import request from "@/utils/request";

// 获取申请类型下拉列表
export function getApplicationTypeList() {
	return request({
		url: "/operation/web/oprationBusinessApplicationNew/getApplicationType",
		method: "get",
	});
}

// 获取申请状态下拉列表
export function getApplicationStatusList() {
	return request({
		url: "/operation/web/oprationBusinessApplicationNew/getApplicationStatus",
		method: "get",
	});
}

// 获取审核动作映射列表
export function getApplicationActionList() {
	return request({
		url: "/operation/web/oprationBusinessApplicationNew/getApplicationAction",
		method: "get",
	});
}

// 查询业务申请列表
export function getBusinessApplicationList(params) {
	return request({
		url: "/operation/web/oprationBusinessApplicationNew/list",
		method: "get",
		params,
	});
}

// 获取业务申请详细信息
export function getBusinessApplicationDetail(id) {
	return request({
		url: `/operation/web/oprationBusinessApplicationNew/${id}`,
		method: "get",
	});
}

// 新增业务申请
export function addBusinessApplication(data) {
	return request({
		url: "/operation/web/oprationBusinessApplicationNew",
		method: "post",
		data,
	});
}

// 修改业务申请
export function updateBusinessApplication(data) {
	return request({
		url: "/operation/web/oprationBusinessApplicationNew",
		method: "put",
		data,
	});
}

// 删除业务申请
export function deleteBusinessApplication(ids) {
	return request({
		url: `/operation/web/oprationBusinessApplicationNew/${ids}`,
		method: "delete",
	});
}

// 审批业务申请
export function handleApplication(data) {
	return request({
		url: "/operation/web/oprationBusinessApplicationNew/handleApplication",
		method: "post",
		data,
	});
}
